package top.tangyh.lamp.care.vo.save;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import top.tangyh.lamp.care.entity.BPgSrx;

import java.math.BigDecimal;
import java.util.List;

@Data
@Schema(description = "输入项入参类")
public class SrxVO {

    //    @NotNull(message = "请输入 输入项id", groups = {BaseEntity.Update.class})
    private Long id;

    private Long pgId;

    @Schema(description = "输入项名称")
    @NotBlank(message = "请输入 输入项名称")
    private String srxName;

    @Schema(description = "输入项类型code")
    @NotBlank(message = "请输入 输入项类型code")
    private String srxTypeCode;

    @Schema(description = "输入项步骤")
    @NotNull(message = "请输入步骤")
    private Integer srxBz;

    @Schema(description = "输入项布局")
    @NotNull(message = "请输入布局")
    private String srxBj;

    @Schema(description = "输入项布局标识")
//    @NotNull(message = "请输入布局标识", )
    private String bjShortName;

    @Schema(description = "普通输入项明细集合")
    private List<SrxDetailNormalVO> normalDetailList;

    @Schema(description = "范围开始")
    private BigDecimal rangeStart;

    @Schema(description = "范围结束")
    private BigDecimal rangeEnd;

    @Schema(description = "是否自定义")
    private Integer isDiy;

    @Schema(description = "数据来源层级1")
    private String srcL1;

    @Schema(description = "数据来源层级2")
    private String srcL2;

    @Schema(description = "数据来源层级3")
    private String srcL3;

    @Schema(description = "是否有总分说明")
    @NotNull(message = "总分说明不能为空，默认否")
    private Integer hasScore;

    @Schema(description = "是否启用分值")
    @NotNull(message = "启用分值不能为空，默认否")
    private Integer enableScore;

//     @Schema(description ="区间明细集合")
//    private List<SrxDetailRangeVO> rangeDetailList;

    public SrxVO(BPgSrx srxPO) {
        this.id = srxPO.getId();
        this.pgId = srxPO.getPgId();
        this.srxName = srxPO.getSrxName();
        this.srxTypeCode = srxPO.getSrxTypeCode();
        this.srxBz = srxPO.getSrxBz();
        this.srxBj = srxPO.getSrxBj();
        this.bjShortName = srxPO.getBjShortName();
        this.rangeStart = srxPO.getRangeStart();
        this.rangeEnd = srxPO.getRangeEnd();
        this.isDiy = srxPO.getIsDiy();
        this.hasScore = srxPO.getHasScore();
        this.srcL1 = srxPO.getSrcL1();
        this.srcL2 = srxPO.getSrcL2();
        this.srcL3 = srxPO.getSrcL3();
        this.enableScore = srxPO.getEnableScore();
    }

    public SrxVO() {
    }
}